﻿using Abp.Dependency;
using Abp.Domain.Uow;
using Abp.EntityFrameworkCore;
using Abp.MultiTenancy;
using Magicodes.Admin.Custom.Fins;
using Magicodes.Admin.Custom.TimeLimits;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Magicodes.Admin.EntityFrameworkCore.Repositories
{
    public  class TimeLimitRepository : AdminRepositoryBase<TimeLimit, long>, ITimeLimitRepository
    { 

        public TimeLimitRepository(IDbContextProvider<AdminDbContext> dbContextProvider)
            : base(dbContextProvider)
        {
             
        }
         
        public async Task ImportFromExcel(List<TimeLimit>  timeLimits)
        {
            base.Context.TimeLimits.RemoveRange(base.Context.TimeLimits);
            base.Context.TimeLimits.AddRange(timeLimits);

            base.Context.SaveChanges();

           
        }
    }
}
